#! /bin/bash
#This programme is wrote to tar the direction
#use the unique name for every file
TARNAME=`ls /home | grep tar`
if [ -z "$TARNAME" ] ; then
mkdir  /home/tar
cd /home/tar
else
cd /home/tar
fi
TARFILE=`date "+%Y-%m-%d-%H-%M-%S"`_done.tar.gz
if [ -d $1 ]; then
tar -zcpf $TARFILE $1
else
Echo "It is error,try again"
fi
echo "$1 has been backup"
